﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Common;
using Common.Attributes;
using Common.Base;
using Common.Base.Result;
using Microsoft.Extensions.Logging;
using Model.Dto;
using Repository;

namespace Service
{
    [Component(ServiceType = typeof(IUserInfoService))]
    public class UserInfoServiceImpl : IUserInfoService
    {
        private readonly ILogger<UserInfoServiceImpl> _logger;
        private readonly IUserInfoRepository _infoRepository;

        public UserInfoServiceImpl(ILogger<UserInfoServiceImpl> logger, IUserInfoRepository infoRepository)
        {
            _logger = logger;
            _infoRepository = infoRepository;
        }

        public async Task<PageData<UserInfoDto>> SelectUserInfoPage(UserInfoPageParamDto infoPageParamDto)
        {
            return await _infoRepository.SelectUserInfoPage(infoPageParamDto);
        }

        public async Task<List<UserInfoDto>> SelectUserInfos(UserInfoDto infoDto)
        {
            return await _infoRepository.SelectUserInfos(infoDto);
        }

        public async Task<UserInfoDto> SelectUserInfo(UserInfoDto infoDto)
        {
            return await _infoRepository.SelectUserInfo(infoDto);
        }

        public async Task<bool> InsertUserInfo(UserInfoDto infoDto)
        {
            return await _infoRepository.InsertUserInfo(infoDto);
        }

        public async Task<bool> UpdateUserInfo(UserInfoDto infoDto)
        {
            return await _infoRepository.UpdateUserInfo(infoDto);
        }

        public async Task<bool> TokenTest()
        {
            return await _infoRepository.TokenTest();
        }

        public async Task<bool> CustomTest()
        {
            return await _infoRepository.CustomTest();
        }
    }
}